<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page import="frm.ssh.util.page.SearchBean"%>
<%@ include file="/jsp/common/common.jsp"%>

<html>
	<head>
		<script language="javascript" src="<%=contextPath%>/js/func.js"type=""></script>
		<script type="text/javascript" src="<%=contextPath%>/js/My97DatePicker/WdatePicker.js"></script>
		<script language="javascript" src="<%=contextPath%>/js/sorttable.js"type=""></script>
		<link rel="stylesheet" type="text/css"	href="<%=contextPath%>/css/sorttable.css">
		<script>
			Ext.onReady(function(){
				var tb = new Ext.Toolbar({
			   		renderTo: document.all.tbar,
			    	items: [
				        {
				            text: '查询',
				            icon:"<%=contextPath%>/images/query.gif",
				            handler:cmt
				        },'-',
				        {
				            text: '增加',
				            icon:"<%=contextPath%>/images/add.gif",
				            handler:function(){
				            	toDetail('0')				            	
				            },
				            hidden:<%=session.getAttribute("btn_addgzrwd_display") != null|| "1".equals(session.getAttribute("SESSION_ISADMIN")) ? false:true%>
				        },'-',
				        {
				            text: '删除',
				            icon:"<%=contextPath%>/images/delete.gif",
				            handler:deleteIt,
				            hidden:<%=session.getAttribute("btn_deletegzrwd_display") != null || "1".equals(session.getAttribute("SESSION_ISADMIN")) ? false:true%>
				        },'-',
				        {
				            text: '清空',
				            icon:"<%=contextPath%>/images/clear.png",
				            handler:resetForm
				        },'->',
				        {
				            text: '查询条件',
				            icon:"<%=contextPath%>/images/down_bottom.gif",
				            handler:displayquerydiv
				        }
			    	]
			    });
			});
		</script>
	</head>
	<body>
		<div id ='tbar'></div>
		<br>
		<div id="Layer" style="position:absolute;display:block left:0px; top:35px; width:100%; height:94%; z-index:1000; overflow:auto;">
		
		<form id="frmM" name="frmM" method="POST" action="<%=contextPath%>/queryUser.do">
			<s:hidden name="searchBean.displayFlag" />		
			<s:hidden name="searchBean.con1" />
			
			<s:hidden name="searchBean.con6" />
			<table width="100%" id="contab">
				<tbody id="querydiv">
				<tr>
					<th>
						日期：
					</th>
					<td width="300">
						<input type="text" size="12" readonly="true" name="searchBean.con2" size="10"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con2')})" id="searchBean.con2" value="${searchBean.con2}"/>
						<img onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con2')})" src="<%=contextPath%>/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
						&nbsp;
						~
						&nbsp;
						<input type="text" size="12" readonly="true" name="searchBean.con3" size="10" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con3')})" id="searchBean.con3" value="${searchBean.con3}"/>
						<img onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con3')})" src="<%=contextPath%>/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
					</td>
					<td>
					<input type="radio" id="searchBean.con5" name="searchBean.con5" value="01" ${searchBean.con5=="01"?"checked":""} onClick="cmt(this);"/>当日
				    <input type="radio" id="searchBean.con5" name="searchBean.con5" value="02" ${searchBean.con5=="02"?"checked":""} onClick="cmt(this);"/>明日
			        </td>
				</tr>
				</tbody>
			</table>
			
			<hr>
			<table width="100%" id="listtab">
			<thead>
				<tr>
					<th   width="25">
						<input name="chkAll" type="checkbox" id="chkAll"
							onclick="javascript:checkAll(this.form, 'id');" value="checkbox">
					</th>
					 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="120">开始时间</td>
					 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="120">结束时间</td>
					 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="80">变电站</td>
					 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="80">班组</td>
					 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="80">负责人</td>
					 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="80">成员</td>
	                 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="30%">工作任务</td>
	                 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="150">车辆</td>
	                 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="40">每日工时</td>
	                 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="100">任务单编号</td>
					 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="100">实际结束日期</td>
	                 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="100">完成情况</td>
	                 <td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="100">遗留问题</td>
				</tr>
            </thead>
				<c:forEach items="${list}" var="detail" >
					<c:if test="${searchBean.con15 == detail.id}">
						<tr ondblclick="javascript:toDetail('<c:out value="${detail.id}"/>')" style="background-color:yellow">
					</c:if>
					<c:if test="${searchBean.con15 != detail.id}">
						<tr ondblclick="javascript:toDetail('<c:out value="${detail.id}"/>')" >
					</c:if>
						<td  width="25">
							<input type="checkbox" name="id" value="${detail.id}" />
						</td>
						 <td width="120">
								<a href="#" onClick="javascript:toDetail('<c:out value="${detail.id}"/>')" >
									${detail.czkssj}
								</a>
						</td>
						<td width="120">
							${detail.czjssj}
								
						</td>
						<td width="80">
							<c:out value="${detail.bdzname}"/>
						</td>
						<td width="80">
							<c:out value="${detail.bzname}"/>
						</td>
						
						<td width="50">
							<c:out value="${detail.zbzname}"/>
						</td>
						<td  width="100" style="text-align:left">
							&nbsp;<c:out value="${detail.zbyname}"/>
						</td>
						
						<td width="30%" style="text-align:left">
							&nbsp;<c:out value="${detail.gzfw}"/>
						</td>
						<td  width="150" style="text-align:left">
							&nbsp;<c:out value="${detail.cxch}"/>
						</td>
						<td  width="40" style="text-align:left">
							&nbsp;<c:out value="${detail.gs}"/>
						</td>
						<td  width="100" style="text-align:left">
							&nbsp;<c:out value="${detail.bh}"/>
						</td>
						<td width="100">
								<a href="#" onClick="javascript:toDetail('<c:out value="${detail.id}"/>')" >
									<fmt:formatDate value="${detail.rq}" pattern="yyyy-MM-dd"/>
								</a>
						</td>
						<td  width="100" style="text-align:left">
							&nbsp;<c:out value="${detail.wcqk}"/>
						</td>
						<td  width="100" style="text-align:left">
							&nbsp;<c:out value="${detail.ylwt}"/>
						</td>
					</tr>
				</c:forEach>

				<c:if test="${list == null || fn:length(list) == 0 }">
					<tr>
						<td colspan="14" style="text-align: center">
							无相关记录
						</td>
					</tr>
				</c:if>
			</table>
			<table width="100%" id="tablestyle2">
				<tr>
					<td>
						<hr />
					</td>
				</tr>
				<tr>
					<td>${pageDown}</td>
				</tr>
			</table>
		</form>
		</div>
	</body>
</html>
<script type="text/javascript">
	var st = new SortableTable(document.getElementById("listtab"),["None","String","String","String","String","String","String", "None","None","String","String","None"]);
</script>
<script language="javascript">

			// 查询
			function cmt(obj){
				document.frmM.action = "<%=contextPath%>/gzrwdWpList!getList.do?page=1&c=c&searchBean.con15=";
				document.frmM.submit();
			}

			// 新建修改进入详细页面
			function toDetail(id){
				
				parent.addTab("生产工作安排【无票】", "<%=contextPath%>/gzrwdWp!initDetail.do?id=" + id,id);
    
			}

			// 删除
			function deleteIt()
			{
				if(!isChecked("id")) {
		 			alert("请选择要删除的记录");
		 			return false;
		 		}
		    	if(confirm("确定要删除选中的记录吗？")) {
		        	document.frmM.action = "<%=contextPath%>/gzrwdWp!delete.do?searchBean.con15=";
					document.frmM.submit();
		    	}
			}
		</script>